package com.atguigu.educms.controller;


import com.atguigu.commonutils.ResultVo;
import com.atguigu.educms.entity.CrmBanner;
import com.atguigu.educms.service.CrmBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//前台管理员系统
@RestController
@CrossOrigin
@RequestMapping("/educms/bannerfront")
@Api(value = "网站首页Banner列表")
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    //查询所有banner
    @GetMapping("getAllBanner")
    @ApiOperation(value = "获取首页banner")
    public ResultVo getAllBanner() {
        List<CrmBanner> list = bannerService.selectAllBanner();
        return ResultVo.ok().data("list", list);
    }
}
